package com.magicsoft.share.adapter.share;

import android.graphics.Paint;
import android.support.annotation.LayoutRes;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.share.CommentList;
import com.makeramen.roundedimageview.RoundedImageView;

/**
 * @author lyf
 * @date 2017/10/30/030
 * 评论列表
 */

public class CommentAdapter extends BaseQuickAdapter<CommentList.ListBean, BaseViewHolder> {
    public CommentAdapter(@LayoutRes int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentList.ListBean item) {
        RoundedImageView iv_head = helper.getView(R.id.iv_head);
        TextView tv_name = helper.getView(R.id.tv_name);
        tv_name.getPaint().setFlags(Paint.FAKE_BOLD_TEXT_FLAG);
        Glide.with(mContext).load(item.getHeadimg()).into(iv_head);
        helper.setText(R.id.tv_name,item.getNickname())
        .setText(R.id.tv_content,item.getContent())
        .setText(R.id.tv_date,item.getCreateTime());
    }

}
